package hsintiao.com.xintiaoAPP.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	//public static String app_id = "2021000116696448";
	public static String app_id = "2021001191637062";

	// 商户私钥，您的PKCS8格式RSA2私钥
    //public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCT3u0UpUWg1LwnWVZJvwuNHQ5gFoJAXzLDc6M3ednLB8tLeiMob9N5G0YAHz4T3HR4zpFWmbPALMgLHG+AWyFqg2hETNbT9x/ERadE4OqDDtfWD9+bccqGu8zQO3lEOIsRATTaQxO4Y6U1D7KfuA6NEnmWIt/BVZvoz90zRwTQEMvNg8xh2uu63FNKSiZJTih0m4o3Qsk9nFUc6mw0+fHWsg1ShoV48rKGXlgYMZ460+ASJkVLDlHz4zTRGp6KJXtjlwin0/7lxKdG89VgyEdANLdo72PffZ3RynxqSrrDWev2w0rFJMsUYFrRxFRBmQOTUKPCtBW6lQVMgPva6ftlAgMBAAECggEAHQ3nTXAv3ysNkTm3f6P/FAoKggzKKPXLlqXJAyR5C7CLXFgyQka+qYQXW/zHiMV/SSFlYzuuGutxnuVGb1T4muIZAZqLd3iOEFWTSTBcQ8YN2Kyjxfo0zgZmdt/IswPdJ0kyZlRZspg5pNRhx4o1qbhglYRirK0yhisZjnK82li05ySxCfdSHLRZwkBExkZQiJiSXQNUlgT4Hy28+LpAr/KYAfYX3UVsLLnYIY5kQ4BtYBbaDTTMBwTH7CZc/W+cJL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MJsnVF9py0JTXHJq28Kv5D3QLo1cwGWyebSvlvSkivc/yP6X6ENyE/C/aHUBEhDYS5jybfwdi+R8XCFwQKBgCGmCoRiCUNQkGuSfqKSJx2BGavqxm9EBMsba8FBZBn3E7oizinrvLK/ulcusFigjfWn+rK0E9lG9832wGH3roniatnr6INEstyDOGqAyelGeh9scZ6fPKJN5Z9XDTdt4KZ9GuPc8vpJeaRmgMKQ/4zqhwG1sEX5igc/KYvlyhcZAoGAMUZkxev4oqb296PIlKcPtmput+2tplSdSW3UIFqkaPA3+VLWfoyuTfoipDCefrXdV5iuJM2JJIR2SJ2VC736OotnaiPj7vLP7Wk2sJwnt7lR63cchNGsVN5M/rGkm0xf1EcKqAK0PLvNDT572k1CIqiC7ZAZgoHcaFEsYhpXRQM=";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    //public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqyT41R9dXzTajM/5C9Z/PnBgvPiLSm92eGEYDNYRCLARhZtBQP7aVkfJQ6qDlrlV7/AsnZOEZ2QYSjFXF0ced6jj6PMyMzmGs9ztxy3U6IX6kVvW4xXHHcJ0GwYvvGk7rPuZgf/KVGBS1Zml+CDWF9vKDgt0IGPwAcWIz3m8bi0zd0YLttRciBJ18CavGImr1HOyou6WvSj1OkYrITEvXzcgo6krZEmKRIv/SWbxI3wOSZjU8VuQ57Z4y7omQ9VqpLr865322nwhrntuoCSihNGGpIGWikQCAXBLFeI8FXFbSPZ9UxbHBXbgHzJlGMmRIDRCEi175DyfDEFfzaFI/wIDAQAB";
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg1dmFu1PiuJlQoOQBBTpgyYIgO7BVuFCyryigXwRm/BR7TG7icv8m/ynZK4EJtYv/xlaNSgwZ6F0+9gsGJKdm9GhFHk6wG5WWMCrfRxZ0Q9SP8RHI37ViroFTv7Ikn5IG/fAppWiF1YuQ6NdUpxqoLjXldvXJN06RfB9P3O0XP3z+a3ly7j2PuQAj8yF8mHt408PsCKuj56joyu0KyrNvadYtw/QjjZB6snt+82eA7AdcHDD6jpoSc7DPnRCOor99HYepaahTulzz+Rz0P0PcpsiL40JJUgIOrC2jZoYMQ6BFG8zAhHHRJmTWc5uzqYveMa7nxTNWQnGu6l9fErGowIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	//public static String notify_url = "http://121.196.124.143:8085/alipay/notifyUrl";
	public static String notify_url = "http://yft.nat100.top/alipay/notifyUrl";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://yft.nat100.top/alipay/returnUrl";
	//public static String return_url = "http://121.196.124.143:8085/alipay/returnUrl";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "UTF-8";
	
	// 支付宝网关
	//public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";

	// 支付宝网关
	//public static String log_path = "D:\\";
	public static String log_path = "/yft/myProject/xtyl/paybill";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

